import {form,util} from 'nuijs';
import router from 'router';
export  function searchlayer(e,elem,data) {
    //查询的弹出层；
    // 使用popover的组件
    //表单的reset
    form({
        width:600,
        height:322,
        template:`
        <form>
        <div class="ui-item e-pt5">
        <span class="e-mt16 e-mt15 ">
            <label class="ui-label e-mr12">
            应用名称
            </label>
            <input type="text" name="appName" class="ui-input ui-input-170" data-input2-options='{"text":"请输入销方名称"}' autocomplete="off">
        </span>
        <span class="e-mt16 e-mt15  ">
            <label class="ui-label e-mr12">
            创建日期
            </label>
            <div class="f-pr Tag Tag-date ui-input ui-input-170 f-dib">
                <input type="text" name="createTime" readonly  class="noinput" data-calendar-options autocomplete="off">
                <b class="iconfont dateicon"></b>
            </div>
        </span>
        <span class="e-mt16 e-mt15 ">
            <label class="ui-label e-mr12">
            企业名称
            </label>
            <input type="text" name="companyName" class="ui-input ui-input-170" data-input2-options='{"text":"请输入销方名称"}' autocomplete="off">
        </span>
        <span class="e-mt16 e-mt15  ">
            <label class="ui-label e-mr12">
            应用标签
            </label>
            <div class="f-pr Tag ui-input ui-input-170 f-dib">
                <div class="con"><div class="Wrap"></div></div>
                <input type="text" unselectable="on" class="noinput" readonly  data-fieldid="appLabelId" data-textname="c_name" data-id="c_key" data-select2-options="${require('../../public/logic/selectMode',true).name}" data-multiple="N" data-source="labellist"  placeholder="请选择">
                <b class="iconfont dir"></b>
            </div>
        </span>
        <span class="e-mt16 e-mt15 ">
            <label class="ui-label e-mr12">
            联系人
            </label>
            <input type="text" name="contactName" class="ui-input ui-input-170" data-input2-options='{"text":"请输入销方名称"}' autocomplete="off">
        </span>
        <span class="e-mt16 e-mt15  ">
            <label class="ui-label e-mr12">
            联系电话
            </label>
            <input type="text" name="contactPhone" class="ui-input ui-input-170" data-input2-options='{"text":"请输入销方名称"}' autocomplete="off">

        </span>
        <span class="e-mt16 e-mt15 ">
            <label class="ui-label e-mr12">
            税号
            </label>
            <input type="text" name="contactCode" class="ui-input ui-input-170" data-input2-options='{"text":"请输入销方名称"}' autocomplete="off">
        </span>
        </div>
        </form>
        `,
        button:[{
            id:'confirm',
            text:'确定',
            callback(self){
                let paging = router.active(true).grid.paging;
                paging.condition = util.getData(self.element.find('form')).result;
                paging.query(true);
                return true;
            }
        }],
        events:{
            'click .Tag-date':function(e,elem,data){
                let element = this.element;
                this.date = $.calendar({
                    target:element.find('[name=createTime]')
                    // onchoose(dates,elem,target){
                    //     target.valid();
                    // }
                });
            }
        },
        onDestroy:function(self){
            this.date && this.date.destroy();
        }
    })
    
}